package com.chb.microservice.provider.hystrix;


import com.chb.microservice.provider.feign.UserFeignClient;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 
 * ClassName: HystrixWrappedServiceBClient<br>
 * Description: TODO 熔断.<br>
 * Reason: TODO ADD REASON(可选) <br>
 *
 * @author dengw
 * @date: 2017年3月6日 下午3:16:15
 * @version V1.0
 * @since JDK 1.8
 */
@Service
public class UserHystrixWrapped  {


	@Autowired
	private UserFeignClient userFeignClient;
	
   // @Override
    @HystrixCommand(groupKey = "helloGroup", fallbackMethod = "fallBackCall")
    public String login() {
    	System.out.println(2);
        return userFeignClient.login();
    }
    //@HystrixCommand(groupKey = "helloGroup1", fallbackMethod = "fallBackCall1")
//    public String fallBackCall() {
//    	System.out.println(2);
//    	 return userFeignClient.login();
//    }
    
    public String fallBackCall() {
   	 return "报错";
   }
}
